package com.ruoyi.api.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.api.mapper.RecRecordMapper;
import com.ruoyi.api.domain.RecRecord;
import com.ruoyi.api.service.IRecRecordService;

/**
 * 识别记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-11
 */
@Service
public class RecRecordServiceImpl implements IRecRecordService 
{
    @Autowired
    private RecRecordMapper recRecordMapper;

    /**
     * 查询识别记录
     * 
     * @param recordId 识别记录主键
     * @return 识别记录
     */
    @Override
    public RecRecord selectRecRecordByRecordId(Long recordId)
    {
        return recRecordMapper.selectRecRecordByRecordId(recordId);
    }

    /**
     * 查询识别记录列表
     * 
     * @param recRecord 识别记录
     * @return 识别记录
     */
    @Override
    public List<RecRecord> selectRecRecordList(RecRecord recRecord)
    {
        return recRecordMapper.selectRecRecordList(recRecord);
    }

    /**
     * 新增识别记录
     * 
     * @param recRecord 识别记录
     * @return 结果
     */
    @Override
    public int insertRecRecord(RecRecord recRecord)
    {
        recRecord.setCreateTime(DateUtils.getNowDate());
        return recRecordMapper.insertRecRecord(recRecord);
    }

    /**
     * 修改识别记录
     * 
     * @param recRecord 识别记录
     * @return 结果
     */
    @Override
    public int updateRecRecord(RecRecord recRecord)
    {
        recRecord.setUpdateTime(DateUtils.getNowDate());
        return recRecordMapper.updateRecRecord(recRecord);
    }

    /**
     * 批量删除识别记录
     * 
     * @param recordIds 需要删除的识别记录主键
     * @return 结果
     */
    @Override
    public int deleteRecRecordByRecordIds(Long[] recordIds)
    {
        return recRecordMapper.deleteRecRecordByRecordIds(recordIds);
    }

    /**
     * 删除识别记录信息
     * 
     * @param recordId 识别记录主键
     * @return 结果
     */
    @Override
    public int deleteRecRecordByRecordId(Long recordId)
    {
        return recRecordMapper.deleteRecRecordByRecordId(recordId);
    }
    
    /**
     * 根据应用ID删除识别记录
     * 
     * @param appId 应用ID
     * @return 结果
     */
    @Override
    public int deleteRecRecordByAppId(Long appId)
    {
        return recRecordMapper.deleteRecRecordByAppId(appId);
    }
    
    /**
     * 根据应用ID批量删除识别记录
     * 
     * @param appIds 应用ID数组
     * @return 结果
     */
    @Override
    public int deleteRecRecordByAppIds(Long[] appIds)
    {
        return recRecordMapper.deleteRecRecordByAppIds(appIds);
    }
}
